﻿@model Forest.Cat.Web.Models.Jobseekers.LoginModel
@{ 
    var ajaxOptions = new AjaxOptions() { HttpMethod = "POST", UpdateTargetId = "loginDialog" };
}
<script type="text/javascript">
    $(function () {
        $("#loginDialog").dialog({
            resizable: false,
            autoOpen: false,
            width: 350,
            height: 250,
            modal: true,
            buttons: {
                "注册": function () {
                    $(this).dialog("close");
                    window.location = '@Url.Action("Register")';
                },
                "登录": function () {
                    $('#btnPopupLogin').click();
                },
                "关闭": function () {
                    $(this).dialog("close");
                }
            }
        });
    });

    function openLoginDialog() {
        $("#loginDialog").dialog("open");
    }
</script>
<div id="loginDialog" title="用户登入">
    @using (Ajax.BeginForm("PopupLogin", ajaxOptions))
    { 
        @Html.ValidationMessage("loginError")
        <br />
        <table cellpadding="0" cellspacing="0">
            <tr>
                <td align="right">
                    <label>
                        用户名</label>&nbsp;<br />
                    &nbsp;
                </td>
                <td>
                    @Html.TextBoxFor(x => x.Email, new { @class = "popupLoginInput" })<br />
                    @Html.ValidationMessageFor(x => x.Email)
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td align="right">
                    <label>
                        密码</label>&nbsp;<br />
                    &nbsp;
                </td>
                <td>
                    @Html.PasswordFor(x => x.Password, new { @class = "popupLoginInput" })<br />
                    @Html.ValidationMessageFor(x => x.Password)
                    &nbsp;
                </td>
            </tr>
        </table>
        <input id="btnPopupLogin" name="btnPopupLogin" value="btnPopupLogin" type="submit" style="display: none" />
    }
</div>
